from datetime import datetime
from enum import IntEnum
from typing import Optional

from app.core.constants import TriggerType


class BaseTrigger:
    trigger_type: TriggerType

    def __init__(self, **kwargs):
        self.params = kwargs

    async def get_next_fire_time(self, previous_fire_time: Optional[datetime]) -> Optional[datetime]:
        """获取下一个执行时间

        Args:
            previous_fire_time: 上一次执行时间

        Returns:
            Optional[datetime]: 下一个执行时间
        """
        raise NotImplementedError("子类必须实现此方法")
